Repository navigation
refactor: convert command examples to @example attributes - #96
Conversation
Convert all old-style comment examples (# > command) to @example attributes in commands.nu. This improves testability and consistency across the codebase. Changes: - Fix bugs in existing @example attributes (wrong function names): * mark-code-block → code-block-marker * create-highlight-command → generate-highlight-print - Convert 12 old-style comment examples to @example format: * convert-output-fences * convert-short-options * get-last-span (6 examples) * can-append-print (3 examples) * generate-inline-output-pipeline * generate-print-statement * generate-table-statement (2 examples) * wrap-in-try-catch * extract-fence-options * build-modified-path - Remove untestable generate-timestamp example (dynamic output) All examples now use consistent @example syntax for automated testing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added meaningful descriptions to all @example attributes in commands.nu, replacing empty strings with explanatory text that describes what each example demonstrates (e.g., "convert output fence to compact format", "expand short option to long form", "pipeline ending with command"). Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove old debugging tip comment that looked like an example - Fix process-code-block-content comment (clarify it generates code, doesn't execute) - Improve generate-inline-output-pipeline comment for clarity - Fix list syntax in extract-fence-options @example result (add comma separator) - Add .claude/ to .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: Convert Command Examples to @example AttributesI've reviewed PR #96 and have the following feedback: Positive Aspects
Issues and ConcernsLine 622-627: The get-last-span examples use --result with strings. Please verify these work correctly by running: help get-last-span Line 673: The generate-inline-output-pipeline example has an extremely long --result string that's hard to read. Consider simplifying. Line 689: The custom table width example modifies env.numd.table-width. Verify @example runs in isolated environments. Line 560-562: The quote-for-print example has nested quotes that might be confusing. Consider adding an explanatory comment. README.md ChangesThe README updates are legitimate side effects of running numd run README.md:
Security and PerformanceNo security concerns or performance impact identified - this is purely documentation. Testing Recommendations
SummaryThis is a high-quality refactoring that significantly improves documentation. Main concerns:
Recommendation: Approve after verification of the @example syntax via help commands. Great work on this comprehensive documentation improvement! |
Summary
# >comment examples to@exampleattributes in commands.nu@exampleattributes@exampleattributes (wrong function names)Changes
Test plan
🤖 Generated with Claude Code